package entity

// 设备
type StdPkgDevice struct {
	Id   string `json:"id"                         gorm:"column:id;size:20;comment:设备编号;"`
	Name string `json:"Name"                         gorm:"column:name;size:50;comment:名称;"`
	//设备能力
	//配置  启动 停止 重启 复位
	Ability string `json:"ability"                         gorm:"column:ability;size:10;comment:设备能力;"`

	Props []StdPkgProp `json:"props"                         gorm:"column:props;size:10;comment:通道;"`
}

func NewMainStdPkgDevice() *StdPkgDevice {
	var r = &StdPkgDevice{
		Id:      "001",
		Name:    "主设备",
		Ability: "",
		Props:   make([]StdPkgProp, 0),
	}
	return r
}
func NewStdPkgDevice(id, name string) *StdPkgDevice {
	var r = &StdPkgDevice{
		Id:      id,
		Name:    name,
		Ability: "",
		Props:   make([]StdPkgProp, 0),
	}
	if "" == r.Name {
		r.Name = "设备" + r.Id
	}
	return r
}
